#include <stdlib.h>
#include <nxos.h>

_Noreturn void abort(void)
{
    NX_Solt threadSolt;
    NX_U32 pid;
    NX_SignalAttr attr;
    NX_SignalInitAttr(&attr, NX_SIGNAL_HANDLER_DEFAULT, 0);
    
    NX_SignalControl(NX_SIGNAL_ABORT, NX_SIGNAL_ABORT, NX_SIGNAL_CMD_UNBLOCK);
    NX_SignalSetAttr(NX_SIGNAL_ABORT, &attr);

    threadSolt = NX_ThreadGetCurrent();
    pid = NX_ThreadGetProcessId(threadSolt);

    NX_SignalSend(pid, NX_SIGNAL_ABORT, 0);
    NX_SignalSend(pid, NX_SIGNAL_KILL, 0);
    
	_Exit(127);
}
